﻿using Camc.Quality.RecordTable.FormBase;
using Camc.Quality.RecordTable.FormClass;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Camc.Quality.RecordTable.FormEntity
{
    public class 除了打保险防松外的总装直属件记录表 : TableBase
    {
        public 除了打保险防松外的总装直属件记录表(int serialNum, Guid workStepEntityId, Guid processesEntityId, int sort, string parentProductName, string fisrtDrawingNum, string secondDrawingNum)
        {
            SerialNum = serialNum;
            WorkStepEntityId = workStepEntityId;
            ProcessesEntityId = processesEntityId;
            Sort = sort;

            ParentProductName = parentProductName;
            FisrtDrawingNum = fisrtDrawingNum;
            SecondDrawingNum = secondDrawingNum;
        }
        public override string FormName { get; protected set; } = "除了打保险防松外的总装直属件记录表";

        public override string ParentProductName_DisplayName { get; protected set; } = "安装位置";
        public override bool ParentProductName_Show { get; protected set; } = true;

        public override string FisrtDrawingNum_DisplayName { get; protected set; } = "零件1";
        public override bool FisrtDrawingNum_Show { get; protected set; } = true;

        public override string SecondDrawingNum_DisplayName { get; protected set; } = "零件2";
        public override bool SecondDrawingNum_Show { get; protected set; } = true;

        public RecordRequirementsEntity SetRecordRequirements(RecordRequirementsEntity entity,string recordMainopoint,string designerDemand)
        {
            entity.SetRecordMainopoint(recordMainopoint, "紧固件材料及规格", false, true, 0);
            entity.SetDesignerDemand(designerDemand, "拧紧力矩要求（N·m）", false, true, 0);
            return entity;
        }
        public MeasuredResultEntity SetMeasuredResult(MeasuredResultEntity entity,string firstMeasuredValues,string measuredActual)
        {
            entity.SetFirstMeasuredValues(firstMeasuredValues, "实际力矩施加值", true, true, 0);
            entity.SetMeasuredActual(measuredActual, "防松方式", true, true, 0);
            return entity;
        }
        /// <summary>
        /// 三检
        /// </summary>
        public InspectionSignatureEntity SetInspectionSignature(InspectionSignatureEntity entity)
        {
            entity.InspectionSignatureName = "三检";
            entity.SetFirstOperator(null, "操作者", true, true, 0, null, "操作者操作时间", true, true, 0);
            entity.SetSecondOperator(null, "互检者", true, true, 0, null, "互检者操作时间", true, true, 0);
            entity.SetThirdOperator(null, "检验员", true, true, 0, null, "检验员操作时间", true, true, 0);
            return entity;
        }
    }
}
